home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.2 Development Libraries
/
SGI IRIX 6.2 Development Libraries.iso
/
dist
/
complib.idb
/
usr
/
share
/
catman
/
p_man
/
cat3
/
complib
/
fft1d.z
/
fft1d
Wrap
Text File
|
1996-03-14
|
6KB
|
133 lines
ccccfffffffftttt1111dddd,,,,zzzzfffffffftttt1111dddd((((3333FFFF)))) ccccfffffffftttt1111dddd,,,,zzzzfffffffftttt1111dddd((((3333FFFF))))
NNNNAAAAMMMMEEEE
ccccfffffffftttt1111dddd,,,, zzzzfffffffftttt1111dddd ---- 1D, Real Complex-to-Complex, Fast Fourier Transforms.
SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
_F_o_r_t_r_a_n :
ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccfffffffftttt1111dddd(((( ssssiiiiggggnnnn,,,, nnnn,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, ccccooooeeeeffffffff ))))
iiiinnnntttteeeeggggeeeerrrr ssssiiiiggggnnnn,,,, nnnn,,,, iiiinnnncccc
ccccoooommmmpppplllleeeexxxx aaaarrrrrrrraaaayyyy((((0000::::((((NNNN----1111))))****iiiinnnncccc)))),,,, ccccooooeeeeffffffff((((nnnn++++11115555))))
ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzfffffffftttt1111dddd(((( ssssiiiiggggnnnn,,,, nnnn,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, ccccooooeeeeffffffff ))))
iiiinnnntttteeeeggggeeeerrrr ssssiiiiggggnnnn,,,, nnnn,,,, iiiinnnncccc
ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx aaaarrrrrrrraaaayyyy((((0000::::((((NNNN----1111))))****iiiinnnncccc)))),,,, ccccooooeeeeffffffff((((nnnn++++11115555))))
_C :
####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
iiiinnnntttt ccccfffffffftttt1111dddd (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn,,,, ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,
iiiinnnntttt iiiinnnncccc,,,, ccccoooommmmpppplllleeeexxxx ****ccccooooeeeeffffffff))));;;;
iiiinnnntttt zzzzfffffffftttt1111dddd (((( iiiinnnntttt ssssiiiiggggnnnn,,,, iiiinnnntttt nnnn,,,, zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,
iiiinnnntttt iiiinnnncccc,,,, zzzzoooommmmpppplllleeeexxxx ****ccccooooeeeeffffffff))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ccccfffffffftttt1111dddd and zzzzfffffffftttt1111dddd compute the Fourier transform of a complex sequence.
The k-th index F(k) of the Fourier transform of a real sequence f(i) is
equal to:
F(k) = Sum ( W^(i*k) * f(i) ), for i =0, ..., (N-1)
W = exp( (Sign*2*sqrt(-1)*PI) / N )
The Direct Fourier transform is performed in-place, so the input sequence
is overwritten by its Fourier transform.
PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
SSSSIIIIGGGGNNNN Integer specifying which sign to be used for the expression of W
(see above) - must be either +1 or -1.
The choice for the sign of the direct transform is just a matter of
convention. For the reverse transform, it must be the opposite.
Unchanged on exit.
NNNN Integer, the number of samples in each sequence.
Unchanged on exit.
AAAARRRRRRRRAAAAYYYY Array containing the samples of the sequence to be transformed.
On input, the element "i" of the sequence is stored as A(i*inc) in
_F_o_r_t_r_a_n , and A[i*inc] in _C.
On exit, the array is overwritten by its transform.
IIIINNNNCCCC Integer, increment between two consecutive elements of a sequence.
Unchanged on exit.
CCCCOOOOEEEEFFFFFFFF Array of at least ( N + 15 ) elements. On entry it contains the
Sines/Cosines and factorization of N. COEFF needs to be initialized with
a call to cfft1di or zfft1di.
PPPPaaaaggggeeee 1111
ccccfffffffftttt1111dddd,,,,zzzzfffffffftttt1111dddd((((3333FFFF)))) ccccfffffffftttt1111dddd,,,,zzzzfffffffftttt1111dddd((((3333FFFF))))
Unchanged on exit.
EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
Direct Fourier Transform of a sequence of 1024 real values. Elements of
sequence are stored with increment (stride) 1.
_F_o_r_t_r_a_n
real array(0:1026-1), coeff(1024+15)
call cfft1di( 1024, coeff)
call cfft1d( -1, 1024, array, 1, coeff)
_C
#include <fft.h>
complex array[1026], *coeff;
coeff = cfft1di( 1024, NULL);
cfft1d( -1, 1024, array, 1, coeff);
SSSSEEEEEEEE AAAALLLLSSSSOOOO
fft, cfft1di, zfft1di, cscal1d, zscal1d
PPPPaaaaggggeeee 2222